﻿
@{
    Layout = null;
}

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link href="/css/admin_login.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="//lib.sinaapp.com/js/jquery/1.12.4/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="/layer/layer.js"></script>  
</head>
<body>
    <div class="admin_login_wrap">
        <h1>后台管理</h1>
        <div class="adming_login_border">
            <div class="admin_input">
                <form action="@(Url.Action("Login"))" method="post">
                    <ul class="admin_items">
                        <li>
                            <label for="email">用户名：</label>
                            <input type="text" name="username" value="" id="username" size="32" class="admin_input_style" />
                        </li>
                        <li>
                            <label for="password">密码：</label>
                            <input type="password" name="password" value="" id="password" size="32" class="admin_input_style" />
                        </li>
                        <li>
                            <input type="button" tabindex="3" value="提交" class="btn btn-primary" id="loginBtn" />
                        </li>
                    </ul>
                </form>
            </div>
        </div>
        <p class="admin_copyright"><a tabindex="5" href="//www.yescent.com/" target="_blank">返回首页</a> &copy; @(DateTime.Now.Year) Powered by <a href="//www.yescent.com/" target="_blank">yescent.com</a></p>
    </div>

    <script>
        $(function () {
            $(document).on('click', '#loginBtn', function () {
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: "@(Url.Action("Login"))",
                    data: $("form").serialize(),
                    success: function (msg) {
                        if (msg.status) {
                            location.href = "@(Url.Action("Index"))";
                        } else {
                            layer.alert(msg.errorMessage, { icon: 5 });
                        }
                        layer.close(index);
                    }
                });
            }).keyup(function (event) {
                if (event.keyCode == 13) {
                    $("#loginBtn").trigger("click");
                }
            });
        });
    </script>

</body>
</html>


